<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>时间选择器Web组件</title>
  <script src="./index.js" type="module"></script>
 
  <script src=" https://cdn.jsdelivr.net/npm/utiltsplugin@0.0.7/dist/UtilPlugin.min.js"></script>
</head>

<body>
  <h1>时间选择器Web组件使用示例</h1>
  <time-picker ></time-picker>
  <script>
    const timePicker = document.querySelector('time-picker');
    timePicker.addEventListener('timeChanged', function (event) {
      console.log('选择的时间是:', event.detail);
    });


    // console.log(UtilPlugin)
// let temp =new UtilPlugin.default(
           
// )
    let temp = new UtilPlugin.default()
    globalThis.eventbus = temp.eventbusFn()

    function valueGet(e){
      globalThis.eventbus.emit("测试",e)
    }
    // document.querySelector("time-picker").setAttribute("onValue",valueGet)
    document.querySelector("time-picker").setAttribute("onValue",valueGet)
    eventbus.on("测试", (data) => {
      console.log("触发了该死的事件:" + data)
    })
  </script>
</body>

</html>